<?
/*
 *  GGB - Gelin's Guest Book.
 *  Copyright (C) 2006  Denis Nelubin aka Gelin
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *  http://gelin.ru
 *  mailto:den@gelin.ru
 *
 *  Description:    Template of add message page.
 *
 *  History:
 *  2006-06-28  Gelin   Initially created.
 *  2007-01-14  Gelin   Modified for gelin.ru
 *  2007-04-18  Gelin   Made "bulletproof"
 *  2009-10-27  Gelin   added notice about premoderation
 */
?>

<? $disabled = $config['behaviour']['disable'] ? 'disabled="disabled"' : "" ?>

<div class="form">

    <form action="<?=$form['action']?>" method="POST" <?=$disabled?>>

        <?include('template/default/errors.php');?>
        <?if ($config['behaviour']['disable']):?>
        Вы не можете добавлять новые сообщения,
        гостевая книга временно отключена. Спасибо.
        <?endif;?>

        <div class="field">
            <?$field = $form['name'];?>
            <label for="name">Имя<sup>*</sup></label>
            <input id="name"
                    type="text" name="<?=$field['name']?>"
                    <?=$disabled?>
                    maxlength="<?=$field['maxlength']?>"
                    value="<?=$field['value']?>"/>
        </div>

        <div class="field">
            <?$field = $form['email'];?>
            <label for="email">E-mail</label>
            <input id="email"
                    type="text" name="<?=$field['name']?>"
                    <?=$disabled?>
                    maxlength="<?=$field['maxlength']?>"
                    value="<?=$field['value']?>"/>
        </div>

        <div class="field">
            <?$field = $form['url'];?>
            <label for="url">URL</label>
            <input id="url"
                    type="text" name="<?=$field['name']?>"
                    <?=$disabled?>
                    maxlength="<?=$field['maxlength']?>"
                    value="<?=$field['value']?>"/>
        </div>

        <div class="field">
            <?$field = $form['message'];?>
            <label for="message">Сообщение<sup>*</sup></label>
            <textarea id="message"
                    name="<?=$field['name']?>"
                    <?=$disabled?>
                    cols="30" rows="5"><?=$field['value']?></textarea>
        </div>

        <div class="field">
            <?include('captcha.php');?>
        </div>

        <div class="button">
            <input type="submit" value="Добавить" <?=$disabled?>/>
        </div>

        <?if ($config['behaviour']['premoderation']):?>
        <div class="notice">
            Ваше сообщение будет добавлено в гостевую книгу после
            одобрения администратором.
        </div>
        <?endif;?>

    </form>

</div>